import React from 'react'
import {
	Switch,Route,Link
} from 'react-router-dom'
import {
	Layout
} from 'antd'
import "./AdminLayout.css"
import logo from './../assets/logo.png'
import Index from './../pages/Index.js'
import MessageSchedules from './../pages/MessageSchedules.js'
import SiderMenu from './adminlayout/SiderMenu.js'

export default class AdminLayout extends React.Component{
	render(){
		return(
			<Layout className="basic-layout">
				<Layout.Sider className="sider">
					<div className="logo">
						<Link to="/home/index"><img src={logo} alt="" height="30px" /></Link>											
						<h3>China Unionpay</h3>
					</div>
					<SiderMenu />	
				</Layout.Sider>
				<Layout>
					<Layout.Header className="header">
						<span className="singn-out" onClick={this.signOut.bind(this)}>退出</span>
						<span className="user-info">欢迎你：admin</span>
					</Layout.Header>
					
					<Layout.Content>
						<Switch>
							<Route path="/home/index" component={Index} />
							<Route path="/home/messageSchedules" component={MessageSchedules} />						 	 	
						</Switch>
					</Layout.Content>
					<Layout.Footer className="footer">
						China Unionpay©2018 Created by SKY D.
					</Layout.Footer>
				</Layout>
			</Layout>
		)
	}
	signOut(){
		//alert("退出成功");
		window.localStorage.removeItem("yuntu_index_user")
		window.location.href="/"
	}
}
